#include <iostream>
#include "fasttext/fasttext.h"
#include "../src/log.h"

int main() {
    std::cout << "Hello, World!" << std::endl;

    std::shared_ptr<fasttext::FastText> model = std::make_shared<fasttext::FastText>();
    std::string model_path = "../pack/models/td_dim32_b2.ftz";
    model->loadModel(model_path.c_str());
    // 假设这是经过分词的文本
    std::string text_seg = "sss";
    fasttext::Predictions predictions;

    std::vector<int32_t> wds = {model->getWordId(text_seg)};

    model->predict(1, wds, predictions);

//    LOGD("word: %d", model->getWordId("调节"));

    std::cout << "预测: " << predictions[0].second << " 置信度: " << std::exp(predictions[0].first) << std::endl;


    return 0;
}
